using System;
using System.Data;
using Sedna.Core.Controls.Actions.Support;

namespace Sedna.Core.Controls.Actions
{
	/// <summary>
	/// Summary description for LoadPermissionDataAction.
	/// </summary>
	public class LoadPermissionDataAction : BaseFilterAction
	{
		public LoadPermissionDataAction()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		protected override System.Collections.ICollection GetResultSet(object filter)
		{
			DataTable dt = new DataTable();
			DataColumn dcId = new DataColumn("ID", typeof(int));
			DataColumn dcName = new DataColumn("NAME", typeof(string));
			DataColumn dcDesc = new DataColumn("DESCRIPTION", typeof(string));
			dt.Columns.AddRange(new DataColumn[] {dcId, dcName, dcDesc});
			for (int i = 1; i <= 4; i++)
			{
				DataRow dr = dt.NewRow();
				dr["ID"] = i;
				dr["NAME"] = "Permission " + i;
				dr["DESCRIPTION"] = "Permission " + i;
				dt.Rows.Add(dr);
			}
			dt.AcceptChanges();
			
			return dt.DefaultView;
		}


	}
}
